package com.example.com.skills_utf8;

import android.app.AlertDialog;
import android.view.Gravity;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;

import com.app.BaseActivity;


// http://blog.csdn.net/centralperk/article/details/7494441
public class _55Activity extends BaseActivity implements OnClickListener{
	
	_55Activity activity = this;
	private Button 
	button1
	,button2
	;
	

	@Override
	public Integer InitLayout() {
		// TODO Auto-generated method stub
		return R.layout.activity_55;
	}

	@Override
	public void InitListener() {
		// TODO Auto-generated method stub
		
		button1.setOnClickListener( new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				 AlertDialog dialog = new AlertDialog.Builder(activity)  
		            .setTitle("title").setMessage("message").create();  
			    Window window = dialog.getWindow();  
			    window.setGravity(Gravity.BOTTOM);  //此处可以设置dialog显示的位置  
			        window.setWindowAnimations(R.style.mystyle);  //添加动画  
			    dialog.show();  
		    
			}
		});
		
		button2.setOnClickListener( new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				 //实例化SelectPicPopupWindow  
				_55SelectPicPopupWindow menuWindow = new _55SelectPicPopupWindow(activity, activity);  
                //显示窗口  
                menuWindow.showAtLocation(button2, Gravity.BOTTOM|Gravity.CENTER_HORIZONTAL, 0, 0); //设置layout在PopupWindow中显示的位置  
                
			}
		});
		
		
	}

	@Override
	public void InitProcess() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void InitView() {
		button1 = (Button)findViewById(R.id.button1);
		button2 = (Button)findViewById(R.id.button2);
		
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		
	}

}




